Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.127 diff -u -p -r1.127 install.php --- install.php 28 Aug 2008 08:40:32 -0000 1.127 +++ install.php 1 Sep 2008 01:24:44 -0000 @@ -401,7 +401,7 @@ function install_settings_form_submit($f * Find all .profile files. */ function install_find_profiles() { - return file_scan_directory('./profiles', '\.profile$', array('.', '..', 'CVS'), 0, TRUE, 'name', 0); + return file_scan_directory('./profiles', '\.profile$', '(\.\.?|CVS)$', 0, TRUE, 'name', 0); } /** @@ -487,7 +487,7 @@ function install_select_profile_form(&$f * Find all .po files for the current profile. */ function install_find_locales($profilename) { - $locales = file_scan_directory('./profiles/' . $profilename . '/translations', '\.po$', array('.', '..', 'CVS'), 0, FALSE); + $locales = file_scan_directory('./profiles/' . $profilename . '/translations', '\.po$', '(\.\.?|CVS)$', 0, FALSE); array_unshift($locales, (object) array('name' => 'en')); return $locales; } Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.788 diff -u -p -r1.788 common.inc --- includes/common.inc 21 Aug 2008 19:36:36 -0000 1.788 +++ includes/common.inc 1 Sep 2008 01:24:44 -0000 @@ -1916,7 +1916,7 @@ function _drupal_load_stylesheet($matche * Delete all cached CSS files. */ function drupal_clear_css_cache() { - file_scan_directory(file_create_path('css'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE); + file_scan_directory(file_create_path('css'), '.*', '(\.\.?|CVS)$', 'file_delete', TRUE); } /** @@ -2289,7 +2289,7 @@ function drupal_build_js_cache($files, $ * Delete all cached JS files. */ function drupal_clear_js_cache() { - file_scan_directory(file_create_path('js'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE); + file_scan_directory(file_create_path('js'), '.*', '(\.\.?|CVS)$', 'file_delete', TRUE); variable_set('javascript_parsed', array()); } @@ -2660,7 +2660,7 @@ function drupal_system_listing($mask, $d // Get current list of items foreach ($searchdir as $dir) { - $files = array_merge($files, file_scan_directory($dir, $mask, array('.', '..', 'CVS'), 0, TRUE, $key, $min_depth)); + $files = array_merge($files, file_scan_directory($dir, $mask, '(\.\.?|CVS)$', 0, TRUE, $key, $min_depth)); } return $files; Index: includes/file.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/file.inc,v retrieving revision 1.128 diff -u -p -r1.128 file.inc --- includes/file.inc 14 Aug 2008 12:10:47 -0000 1.128 +++ includes/file.inc 1 Sep 2008 01:24:44 -0000 @@ -893,7 +893,7 @@ function file_download() { * @param $mask * The regular expression of the files to find. * @param $nomask - * An array of files/directories to ignore. + * The regular expression of the files to ignore. * @param $callback * The callback function to call for each match. * @param $recurse @@ -914,13 +914,13 @@ function file_download() { * "path", "basename", and "name" members corresponding to the * matching files. */ -function file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $callback = 0, $recurse = TRUE, $key = 'filename', $min_depth = 0, $depth = 0) { +function file_scan_directory($dir, $mask, $nomask = '(\.\.?|CVS)$', $callback = 0, $recurse = TRUE, $key = 'filename', $min_depth = 0, $depth = 0) { $key = (in_array($key, array('filename', 'basename', 'name')) ? $key : 'filename'); $files = array(); if (is_dir($dir) && $handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { - if (!in_array($file, $nomask) && $file[0] != '.') { + if (!ereg($nomask, $file) && $file[0] != '.') { if (is_dir("$dir/$file") && $recurse) { // Give priority to files in this folder by merging them in after any subdirectory files. $files = array_merge(file_scan_directory("$dir/$file", $mask, $nomask, $callback, $recurse, $key, $min_depth, $depth + 1), $files); Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.180 diff -u -p -r1.180 locale.inc --- includes/locale.inc 21 Aug 2008 19:36:36 -0000 1.180 +++ includes/locale.inc 1 Sep 2008 01:24:44 -0000 @@ -2478,7 +2478,7 @@ function locale_batch_by_language($langc // with names ending with $langcode.po. This allows for filenames // like node-module.de.po to let translators use small files and // be able to import in smaller chunks. - $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '(^|\.)' . $langcode . '\.po$', array('.', '..', 'CVS'), 0, FALSE)); + $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '(^|\.)' . $langcode . '\.po$', '(\.\.?|CVS)$', 0, FALSE)); $components[] = $component->name; } @@ -2510,7 +2510,7 @@ function locale_batch_by_component($comp // as $langcode.po or with names ending with $langcode.po. This allows // for filenames like node-module.de.po to let translators use small // files and be able to import in smaller chunks. - $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '(^|\.)(' . $language_list . ')\.po$', array('.', '..', 'CVS'), 0, FALSE)); + $files = array_merge($files, file_scan_directory(dirname($component->filename) . '/translations', '(^|\.)(' . $language_list . ')\.po$','(\.\.?|CVS)$' , 0, FALSE)); } } return _locale_batch_build($files, $finished);